<%if project%>
  <%if label == 'files' %>
    <%@cats = project.file_categories%>
  <%elsif label == 'writeboards'%>
    <%@cats = project.wb_categories%>
  <%else label == 'msg'%>
     <%@cats = project.msg_categories%>
  <%end%>
<%else%>
  <%if label == 'fs' %>
    <%@cats = company.file_categories%>
  <%elsif label == 'wb'%>
    <%@cats = company.wb_categories%>
  <%else%>
    <%@cats = company.msg_categories%>
  <%end%>
<%end%>

<%@cats.each do |cat|%>
<div class="activity_item" id="cat_item_<%=cat.id%>">
 <%if project%>
   <%=render :partial=>'categories/show_item',:locals=>{:cat=>cat,:label=>label,:project=>project}%>
 <%else%>
  <%=render :partial=>'categories/show_item',:locals=>{:cat=>cat,:label=>label,:project=>nil,:new_cat=>new_cat}%>
 <%end%>
</div>
<%end%>
<%if project%>
  <span id="new_cat" class=admin style="display:none">
    <%=render :partial=>'categories/new_item_label',:locals=>{:project=>project,:label=>label,:new_cat=>nil}%>
  </span>
<%elsif company%>
<span id="new_cat<%=(new_cat.nil? ? "" : "_" + new_cat.to_s)%>" class=admin style="display:none">
  <%=render :partial=>'categories/new_item_label',:locals=>{:company=>company,:label=>label,:new_cat=>new_cat,:project=>project}%>
</span>
<%end%>
